﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication3
{
    public static class CollectionUtilitiesExtensions
    {
        /// <summary>
        /// Put a foreach on IList... real hard there microsoft!!
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="list"></param>
        /// <param name="action"></param>
        public static void ForEach<T>(this IList<T> list, Action<T> action)
        {
            if (list == null) return;

            for (var i = 0; i < list.Count; i++)
            {
                action(list[i]);
            }
        }
    }
}
